how to do in java